package com.example.administrator.gilde_demo;

import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.ImageView;

import com.bumptech.glide.DrawableRequestBuilder;
import com.bumptech.glide.Glide;

import java.io.File;

public class Main2Activity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main2);

        ImageView img = (ImageView) findViewById(R.id.img);
        ImageView img2 = (ImageView) findViewById(R.id.img2);

        String url = "/storagated/0/Movies/my.mp4";
        //模糊图
        String u2 = "http://file05.16sucai.com/2015/0618/d646670c806789cd7b24cb279b8f98c0.jpg";
        //高清图
        String u3 = "http://pic.90sjimg.com/back_pic/u/00/05/60/99/55efebd0c6f42.jpg";
        //显示本地视频
        Glide
                .with(this)
                .load(Uri.fromFile(new File(url)))
                .into(img);

        //进阶缩略图
        DrawableRequestBuilder<String> thumbnailRequest = Glide
                .with(this)
                .load(u2);

        Glide
                .with(this)
                .load(u3)
                .thumbnail(thumbnailRequest)
                .into(img2);
    }
}
